import 'package:flutter/material.dart';

class DialogSheet extends Dialog {
  final bool outsideDismiss;
  final Function dismissCallback;
  final infos;
  DialogSheet(
      {Key key, this.outsideDismiss = true, this.dismissCallback, this.infos})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    _dismissDialog() {
      if (dismissCallback != null) {
        dismissCallback();
      }
      Navigator.of(context).pop();
      return false;
    }

    return new Padding(
      padding: const EdgeInsets.all(0.0),
      child: GestureDetector(
        onTap: outsideDismiss ? _dismissDialog : null,
        child: Material(
          type: MaterialType.transparency,
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.end,
            children: <Widget>[
              new GestureDetector(
                behavior: HitTestBehavior.translucent,
                onTap: () {
                  FocusScope.of(context).requestFocus(FocusNode());
                },
                child: Container(
                  width: double.infinity,
                  height: 300.0,
                  padding: EdgeInsets.only(bottom: 20.0),
                  color: Color.fromRGBO(255, 255, 255, 1),
                  child: Center(
                    child: Text('ResCon'),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
